<template>
    <view class="content">
        <div class="statistics-warp">
            <div class="sitem" v-for="(item, index) in list" :key="index">
                <image :src="item.user_photo" mode="aspectFill" class="cimages"></image>
                <div class="sinfo-border">
                    <div class="sinfo">
                        <h1>{{item.user_nickname}}</h1>
                        <p>{{item.browse_time}}</p>
                    </div>
                </div>
            </div>
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            list: [],
            page: '',
            is_loading: true,
            shop_info: [],
            isEmpty: false
        };
    },
    onShow() {
        this.shop_info = uni.getStorageSync('userinfo');
        this.getData();
    },
    // 到达底部加载更多
    onReachBottom() {
        if (this.is_loading) {
            this.getData();
        }
    },
    methods: {
        getData() {
            let t = this,
                param = {};
            param.is_loading = true;
            param.url = 'api/shop/home/touristall';
            param.data = {};
            param.data.page = t.page;
            param.data.shop_id = t.shop_info.id;
            param.data.strip = 15;
            t.util.requests(param, res => {
                res = res.data.data;
                t.isEmpty = true;
                if (res.tou.length == 0) {
                    t.is_loading = false;
                    return false;
                }
                t.list = t.list.concat(res.tou);
                t.page++;
            });
        }
    }
};
</script>
<style>
.statistics-warp {
    margin: 30upx;
}

.sitem {
    padding: 20upx 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cimages {
    width: 110upx;
    height: 110upx;
    background: #f8f8f8;
    border-radius: 50%;
}

.sinfo-border {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e6e6e6;
    height: 110upx;
    flex: 1;
    margin-left: 20upx;
}
.sinfo {
    flex: 1;
}

.sinfo h1 {
    font-size: 28upx;
    color: #242424;
    margin-bottom: 10upx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
}

.sinfo p {
    font-size: 26upx;
    color: #999;
}

.count {
    font-size: 28upx;
    color: #fc21fc;
    width: 100upx;
    text-align: right;
}
</style>
